PROJECT(logx)

IF(COMMAND CMAKE_POLICY)
	CMAKE_POLICY(SET CMP0000 OLD)
	CMAKE_POLICY(SET CMP0003 OLD)
	CMAKE_POLICY(SET CMP0013 OLD)
	CMAKE_POLICY(SET CMP0014 NEW)
ENDIF()

SET(CMAKE_USE_RELATIVE_PATHS on)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin)
LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/bin)
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include)

IF(MSVC)
	ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
ELSEIF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
	SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -std=c++11)
ENDIF()
IF(UNIX)
	SET(CMAKE_CXX_COMPILE_FLAGS ${CMAKE_CXX_COMPILE_FLAGS} -pthread)
	SET(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} -pthread)
ENDIF()

ADD_SUBDIRECTORY(logx .)
ADD_SUBDIRECTORY(unittest .)